const { ipcRenderer, contextBridge } = require('electron')

// 关闭登录的窗口
const closeWinLogin = () => {
    ipcRenderer.send('event-win-closeLoginWin')
}

// 接收扫码登录后传递的cookie
const receiveCookie = (cookie) => {
    console.log('渲染进程cookie');
    ipcRenderer.send('event-win-sendCookie', cookie)
}

contextBridge.exposeInMainWorld('loginApi', {
    closeWinLogin,
    receiveCookie
})
